﻿using System;
using System.Text;
using System.Windows.Forms;

namespace AiMoInGH.PrinterForm
{
    class PrinterForm : Form
    {

        readonly StringBuilder m_StringBuilder;


        public PrinterForm(StringBuilder m_StringBuilder)
        {
            this.m_StringBuilder = m_StringBuilder;
            InitializeComponent();
        }

        public void SyncContent()
        {
            if (InvokeRequired)
            {
                Invoke(new Action(SyncContent));
                return;
            }
            PrinterTextBox.Text = m_StringBuilder.ToString();
        }

        private TextBox PrinterTextBox;

        private void InitializeComponent()
        {
            this.PrinterTextBox = new System.Windows.Forms.TextBox();
            this.SuspendLayout();
            // 
            // PrinterTextBox
            // 
            this.PrinterTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
            | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.PrinterTextBox.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(28)))), ((int)(((byte)(28)))), ((int)(((byte)(28)))));
            this.PrinterTextBox.BorderStyle = System.Windows.Forms.BorderStyle.None;
            this.PrinterTextBox.ForeColor = System.Drawing.Color.White;
            this.PrinterTextBox.Location = new System.Drawing.Point(12, 12);
            this.PrinterTextBox.Multiline = true;
            this.PrinterTextBox.Name = "PrinterTextBox";
            this.PrinterTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
            this.PrinterTextBox.Size = new System.Drawing.Size(819, 736);
            this.PrinterTextBox.TabIndex = 0;
            this.PrinterTextBox.WordWrap = false;
            // 
            // PrinterForm
            // 
            this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(10)))), ((int)(((byte)(10)))), ((int)(((byte)(10)))));
            this.ClientSize = new System.Drawing.Size(843, 760);
            this.Controls.Add(this.PrinterTextBox);
            this.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            this.Name = "PrinterForm";
            this.Text = "AiMo C# Printer";
            this.ResumeLayout(false);
            this.PerformLayout();

        }
    }
}
